package com.trkj.service;

import com.trkj.dao.YardDao;
import com.trkj.entity.YardEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 车场
 */
@Service
@Slf4j
public class YardServiceImpl implements YardService{
    @Autowired
    private YardDao yardDao;


    /**
     * 新增
     * @param yardEntity
     * @return
     */
    @Override
    public boolean insertYard(YardEntity yardEntity){
        int count=yardDao.insertYard(yardEntity);
        return count>0;
    }

    @Override
    public List<YardEntity> selectYard(){
        List<YardEntity> list=yardDao.selectYard();
        return list;
    }

    public boolean updateYard(YardEntity yardEntity){
        int count=yardDao.updateYard(yardEntity);
        return  count>0;
    }


    public boolean deleteYard(int id){
        int count=yardDao.deleteYard(id);
        return count>0;
    }

    @Override
    public List<YardEntity> selectCar(int id) {
        List<YardEntity> list=yardDao.selectCar(id);
        return list;
    }
}